// pages/settings/help/help.js
var app = getApp();
var appData = getApp().globalData;

Page({
  data: {
    helpArr: [
      { id: 0, name: "（样例）领取不成功", cont: '（样例）样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答~', time: '2019/01/01'},
      { id: 1, name: "（样例）如何兑换", cont: '（样例）样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答。', time: '2019/01/02' },
      { id: 2, name: "（样例）其他等问题", cont: '（样例）样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答样例回答。', time: '2019/01/03'},
    ],
    Url: app.globalData.Url + 'assets/bgimg/',
  },
  tap: function (e) {
    console.log(e);
    var trg = this.data.helpArr[e.currentTarget.id];
    wx.navigateTo({
      url: 'content?name=' + trg.name + '&content=' + trg.cont + '&time=' + trg.time,
    })
  },
/*
  switch(e.currentTarget.id) {
    case '1': content = '切换一下页面，或者关掉微信重新开一遍试试~'; break;
    case '2': content = '可能是经纬度限制，或是发起人本身的经纬度偏差。可以重新发一个签到。'; break;
  }
    wx.showModal({
      showCancel: false,
      title: '',
      content: content,
    })
*/

  phoneCall: e => {
    wx.makePhoneCall({
      phoneNumber: '18805708888', //此号码并非真实电话号码，仅用于测试
      success: e => {
        console.log("拨打电话成功！")
      },

      fail: e => {
        wx.showModal({
          title: '帮助',
          content: '您可以将写下您的信息并提交，我们诚挚听取您的反馈意见！',
          confirmText: '写反馈',
          success(res) { if (res.confirm) { wx.navigateTo({ url: 'feedback' }) } }
        })
        console.log("拨打电话取消！")
      }
    })
  },

 
  onReady: function () {

  },

  onShareAppMessage: function () {

  }
})